export const foo = () => {
  console.log("f!o!!");
}

let cache = {
    amount:0
}   
//清空定时器副作用这些内容
if(import.meta.hot){
  import.meta.hot.dispose(()=> {
    if (timer){
     clearInterval(timer)
    } 
  })
  console.log( import.meta.hot.data);
  
  cache = import.meta.hot.data.cache = {
    amount: import.meta.hot.data.cache ? import.meta.hot.data.cache.amount : 0
  }
}

let timer =  setInterval(()=>{
      cache.amount++;
       console.log(cache.amount) 
  },1000) 